home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
001
/
pibt40s1.arc
/
EXECUTC2.MOD
< prev
next >
Wrap
Text File
|
1987-09-03
|
42KB
|
1,077 lines
(*----------------------------------------------------------------------*)
BEGIN (* Execute_Command *)
(* Save current state of important params *)
Alter_Status := FALSE;
Save_Do_Status_Line := Do_Status_Line;
(* Don't get confused by previous *)
(* script strings if manual entry *)
IF ( NOT ( Use_Script OR Script_Learn_Mode ) ) THEN
BEGIN
Script_String [0] := #0;
Script_String_2[0] := #0;
Script_Integer_1 := 0;
END;
(* Execute chosen command *)
{
CASE Command Of
}
(* Use jump table to avoid time-consuming *)
(* CASE statement. *)
I := ORD( Command );
INLINE(
$8B/$9E/>I { MOV BX,[BP+>I] ;Pick up ORD(Command)}
/$89/$D8 { MOV AX,BX ;Command}
/$D1/$E3 { SHL BX,1 ;Command * 2}
/$01/$C3 { ADD BX,AX ;Command * 3}
/$B8/>*+6 { MOV AX,>*+6 ;Address of first GOTO}
/$01/$C3 { ADD BX,AX ;Add offset of command}
/$FF/$E3 { JMP BX ;Branch to proper GOTO}
);
GOTO LEndCase;
GOTO LAddLFSy;
GOTO LAlarmSy;
GOTO LAreaCodeSy;
GOTO LBreakSy;
GOTO LEndCase;
GOTO LCaptureSy;
GOTO LEndCase;
GOTO LChDirSy;
GOTO LClearSy;
GOTO LCloseSy;
GOTO LClrEolSy;
GOTO LCommFlushSy;
GOTO LDeclareSy;
GOTO LDelaySy;
GOTO LDelLineSy;
GOTO LDialSy;
GOTO LEndCase;
GOTO LDosSy;
GOTO LEchoSy;
GOTO LEditSy;
GOTO LEndCase;
GOTO LEndCase;
GOTO LEndCase;
GOTO LEndCase;
GOTO LEndCase;
GOTO LEndCase;
GOTO LEndCase;
GOTO LEndCase;
GOTO LExecuteSy;
GOTO LExeNewSy;
GOTO LExitSy;
GOTO LExitAllSy;
GOTO LFastCSy;
GOTO LFileSy;
GOTO LEndCase;
GOTO LGetDirSy;
GOTO LGetParamSy;
GOTO LGetVarSy;
GOTO LGossipSy;
GOTO LGoToSy;
GOTO LGoToXYSy;
GOTO LHangUpSy;
GOTO LHostSy;
GOTO LIfConSy;
GOTO LIfDialSy;
GOTO LIfEofSy;
GOTO LIfExistsSy;
GOTO LIfFoundSy;
GOTO LIfLocStrSy;
GOTO LIfOkSy;
GOTO LIfOpSy;
GOTO LIfRemStrSy;
GOTO LImportSy;
GOTO LInfoSy;
GOTO LInputSy;
GOTO LInsLineSy;
GOTO LKeyDefSy;
GOTO LKeyFlushSy;
GOTO LKeySendSy;
GOTO LKeySy;
GOTO LEndCase;
GOTO LLogSy;
GOTO LMenuSy;
GOTO LMessageSy;
GOTO LMuteSy;
GOTO LOpenSy;
GOTO LParamSy;
GOTO LPImportSy;
GOTO LEndCase;
GOTO LQuitSy;
GOTO LReadSy;
GOTO LReadLnSy;
GOTO LReceiveSy;
GOTO LReDialSy;
GOTO LEndCase;
GOTO LResetSy;
GOTO LReturnSy;
GOTO LRInputSy;
GOTO LScriptSy;
GOTO LSDumpSy;
GOTO LSendSy;
GOTO LSetSy;
GOTO LSetParamSy;
GOTO LSetVarSy;
GOTO LSTextSy;
GOTO LEndCase;
GOTO LTextSy;
GOTO LTimersSy;
GOTO LTranslateSy;
GOTO LEndCase;
GOTO LViewSy;
GOTO LWaitSy;
GOTO LEndCase;
GOTO LEndCase;
GOTO LEndCase;
GOTO LEndCase;
GOTO LEndCase;
GOTO LEndCase;
GOTO LEndCase;
GOTO LEndCase;
GOTO LWhereXYSy;
GOTO LEndCase;
GOTO LWriteSy;
GOTO LWriteLnSy;
GOTO LWriteLogSy;
GOTO LZapVarSy;
GOTO LEndCase;
GOTO LEndCase;
LAddLFSy : BEGIN
Toggle_Option( 'Add line feeds', Add_LF );
Alter_Status := TRUE;
END;
GOTO LEndCase;
LAlarmSy : FOR I := 1 TO 5 DO
BEGIN
Menu_Beep;
DELAY( 3 * Tenth_Of_A_Second_Delay );
END;
GOTO LEndCase;
LAreaCodeSy : IF MyLoadOverlay( 0 , PT4UTIL, 'PT4UTIL.CHN' ) THEN
GetAreaCode;
GOTO LEndCase;
LBreakSy : BEGIN
Async_Send_Break;
IF Script_Learn_Mode THEN
BEGIN
IF ( LENGTH( Script_String ) > 0 ) THEN
WRITELN( Script_File , 'SText "', Script_String, '"' );
Script_String[0] := #0;
Script_Learn_Line_Count := 0;
Script_Wait_Generated := FALSE;
WRITELN( Script_File , 'Break' );
END;
GOTO LEndCase;
END;
LCaptureSy : BEGIN
IF MyLoadOverlay( 0 , PT4UTIL, 'PT4UTIL.CHN' ) THEN
Get_Capture_File( Script_String , Script_String_2 );
Alter_Status := TRUE;
END;
GOTO LEndCase;
LChDirSy : Dir_Set_Default_Drive( Script_String_2[1] );
Script_IO_Error := Dir_Set_Current_Path( Script_String );
GOTO LEndCase;
LClearSy : Clear_Window;
GOTO LEndCase;
LCloseSy : BEGIN
IF ( ( Script_Integer_1 < 1 ) OR
( Script_Integer_1 > MaxScriptOpenFiles ) ) THEN
BEGIN
Script_IO_Error := 999;
GOTO LEndCase;
END;
IF Script_File_Used[Script_Integer_1] THEN
BEGIN
IF Script_File_List[Script_Integer_1]^.Opened THEN
BEGIN
(*$I-*)
CLOSE( Script_File_List[Script_Integer_1]^.F );
(*$I+*)
Script_IO_Error := INT24Result;
END;
DISPOSE( Script_File_List[Script_Integer_1] );
Script_File_Used[Script_Integer_1] := FALSE;
END;
GOTO LEndCase;
END;
LClrEolSy : ClrEol;
GOTO LEndCase;
LCommFlushSy: Async_Purge_Buffer;
GOTO LEndCase;
LPImportSy :
LImportSy :
LDeclareSy : Allocate_Variable;
GOTO LEndCase;
LDelaySy : DELAY( Delay_Time );
GOTO LEndCase;
LDelLineSy : DelLine;
GOTO LEndCase;
LDialSy :
LReDialSy : BEGIN
T_Type := Terminal_To_Emulate;
IF MyLoadOverlay( 0 , PT4DIAL, 'PT4DIAL.CHN' ) THEN
PibDialer( ( Command = ReDialSy ) , Script_String ,
( Script_Integer_1 = 0 ) );
Script_String[0] := #0;
Done := ( Terminal_To_Emulate <> T_Type );
IF Read_In_Script THEN
BEGIN
Read_In_Script := FALSE;
IF MyLoadOverlay( 0 , PT4SCRI, 'PT4SCRI.CHN' ) THEN
Process_Script( Script_File_Name , 'E');
END;
Alter_Status := TRUE;
GOTO LEndCase;
END;
LDosSy : BEGIN
DosJump( Script_String );
Script_String[0] := #0;
GOTO LEndCase;
END;
LEchoSy : BEGIN
Toggle_Option( 'Local Echo', Local_Echo );
Alter_Status := TRUE;
END;
GOTO LEndCase;
LEditSy : IF MyLoadOverlay( 0 , PT4UTIL, 'PT4UTIL.CHN' ) THEN
Edit_A_Line;
GOTO LEndCase;
LExitSy : IF Script_File_Mode THEN
BEGIN
Alter_Status := TRUE;
IF ( Script_Stack_Depth = 0 ) THEN
BEGIN
IF Script_Command_Key_Mode THEN
BEGIN
Script_Command_Key_Mode := FALSE;
Script_File_Mode := FALSE;
END
ELSE
BEGIN
IF Auto_Unload_Scripts THEN
Unload_This_Script;
Toggle_Option( 'Script Mode', Script_File_Mode );
END;
Clear_Script_Variables;
END
ELSE
BEGIN
IF Auto_Unload_Scripts THEN
Unload_This_Script;
(* Free space for variable values *)
Zap_Script_Variables( 3 ,
Script_Variable_Count );
(* Free space for variable pointers *)
FREEMEM( Script_Variables ,
( Script_Variable_Count + 3 ) * SizeOf( Script_Variables^[1] ) );
(* Free space for any parameters *)
IF ( Script_Parameter_Count > 0 ) THEN
DISPOSE( Script_Parameters );
WITH Script_Stack_Position[Script_Stack_Depth] DO
BEGIN
Script_Buffer := Buffer_Ptr;
Script_Buffer_Pos := Buffer_Pos;
Current_Script_Num := Script_Num;
Script_Variables := Vars_Ptr;
Script_Variable_Count := Vars_Count;
Script_Parameters := Params_Ptr;
Script_Parameter_Count := Params_Count;
Script_Parameter_Got := Params_Got;
Prev_Script_Variables := Prev_Ptr;
END;
Script_Stack_Depth := PRED( Script_Stack_Depth );
END;
END;
GOTO LEndCase;
LExitAllSy : BEGIN
Exit_All_Scripts;
Alter_Status := TRUE;
END;
GOTO LEndCase;
LFastCSy : IF MyLoadOverlay( 0 , PT4UTIL, 'PT4UTIL.CHN' ) THEN
Fast_Change_Params;
GOTO LEndCase;
LFileSy : REPEAT
IF MyLoadOverlay( 0 , PT4UTIL, 'PT4UTIL.CHN' ) THEN
BEGIN
PibFileManipulation( File_Done ,
Do_Editing , Do_Viewing );
IF Do_Editing THEN
BEGIN
IF ( LENGTH( Editor_Name ) > 0 ) THEN
BEGIN
IF ( POS( '%F' , Editor_Name ) > 0 ) THEN
Fix_Up_File_Name( 'Edit',
Editor_Name,
S )
ELSE
S := Editor_Name;
DosJump( S );
END
ELSE IF MyLoadOverlay( 0 , PT4EDIT, 'PT4EDIT.CHN' ) THEN
PibEditor
END
ELSE IF Do_Viewing THEN
BEGIN
IF ( LENGTH( Browser_Name ) > 0 ) THEN
BEGIN
IF ( POS( '%F' , Browser_Name ) > 0 ) THEN
Fix_Up_File_Name( 'View',
Browser_Name,
S )
ELSE
S := Browser_Name;
DosJump( S );
END
ELSE
View_A_File;
END;
END
ELSE
File_Done := TRUE;
UNTIL( File_Done );
GOTO LEndCase;
LGetDirSy : BEGIN
Script_String := Dir_Get_Default_Drive;
Script_IO_Error := Dir_Get_Current_Path( Script_String[1] ,
Script_String_2 );
Script_Variables^[Script_Integer_1].Var_Value^ := Script_String;
IF ( Script_IO_Error <> 0 ) THEN
Script_String_2[0] := #0;
Script_Variables^[Script_Integer_2].Var_Value^ := Script_String_2;
END;
GOTO LEndCase;
LGetVarSy : GOTO LEndCase;
LGossipSy : BEGIN
Toggle_Option( 'Gossip mode', Gossip_Mode_On );
Done := TRUE;
IF Gossip_Mode_On THEN
BEGIN
Saved_Gossip_Term := Terminal_To_Emulate;
Terminal_To_Emulate := Gossip;
END
ELSE
BEGIN
Terminal_To_Emulate := Saved_Gossip_Term;
END;
GOTO LEndCase;
END;
LGoToSy : Script_Buffer_Pos := PRED( Script_Integer_1 );
GOTO LEndCase;
LGoToXYSy : GoToXY( Script_Integer_1, Script_Integer_2 );
GOTO LEndCase;
LHangUpSy : BEGIN (* Hang-up Phone *)
Save_Partial_Screen( Saved_Screen, 10, 10, 60, 15 );
Draw_Menu_Frame( 10, 10, 60, 15, Menu_Frame_Color,
Menu_Title_Color, Menu_Text_Color,
'' );
WRITELN;
WRITELN('*** Hanging up the phone ***');
(* Hang up the phone *)
HangUpPhone;
IF Async_Carrier_Detect THEN
WRITELN('*** Phone not hung up, try again ***')
ELSE
BEGIN
WRITELN('*** Phone hung up ***');
Write_Log('Phone hung up', FALSE , FALSE );
END;
DELAY( Two_Second_Delay );
Restore_Screen( Saved_Screen );
Reset_Global_Colors;
GOTO LEndCase;
END (* Hang-up Phone *);
LHostSy : BEGIN (* Set host mode *)
Done := TRUE;
Saved_Gossip_Term := Terminal_To_Emulate;
Terminal_To_Emulate := HostMode;
GOTO LEndCase;
END (* Set host mode *);
LIfConSy : Do_Simple_If( Async_Carrier_Detect );
GOTO LEndCase;
LIfDialSy : Do_Simple_If( Script_Dialed );
GOTO LEndCase;
LIfEofSy : GOTO LEndCase;
LIfExistsSy : BEGIN
(*$I-*)
ASSIGN( F , Script_String );
RESET ( F );
(*$I+*)
I := Int24Result;
(*$I-*)
CLOSE ( F );
(*$I+*)
J := Int24Result;
Do_Simple_If( ( I = 0 ) );
GOTO LEndCase;
END;
LIfFoundSy : Do_Simple_If( Script_Wait_Found );
GOTO LEndCase;
LIfLocStrSy : BEGIN
IF ( LENGTH( Script_Reply ) > 0 ) AND
( LENGTH( Script_String ) > 0 ) THEN
Script_Reply_Found :=
( POS( Script_Reply , Script_String ) > 0 );
Do_Simple_If( Script_Reply_Found );
GOTO LEndCase;
END;
LIfOKSy : Do_Simple_If( Script_IO_Error <> 0 );
GOTO LEndCase;
LIfOpSy : BEGIN
Execute_Stack( 0 );
I := ( ORD( Script_Variables^[0].Var_Value^[2] ) SHL 8 ) OR
ORD( Script_Variables^[0].Var_Value^[1] );
{
IF Debug_Mode THEN
Debug_Write('---> IF returns ' + ITOS( I ) );
}
IF ( ( I AND 1 ) = 1 ) THEN
Script_Buffer_Pos := PRED( Script_Integer_2 )
ELSE
Script_Buffer_Pos := PRED( Script_Integer_3 );
GOTO LEndCase;
END;
LIfRemStrSy : BEGIN
IF ( LENGTH( Script_Remote_Reply ) > 0 ) AND
( LENGTH( Script_String ) > 0 ) THEN
Script_Remote_Reply_OK :=
( POS( Script_Remote_Reply , Script_String ) > 0 );
Do_Simple_If( Script_Remote_Reply_OK );
GOTO LEndCase;
END;
LInfoSy : IF MyLoadOverlay( 0 , PT4UTIL, 'PT4UTIL.CHN' ) THEN
Display_Help( FALSE );
GOTO LEndCase;
LInputSy : BEGIN
WRITE( Script_String );
Script_Reply[0] := #0;
Read_Edited_String( Script_Reply );
Script_Reply_Found := FALSE;
IF ( Script_Integer_1 > 2 ) THEN
BEGIN
Script_Variables^[Script_Integer_1].Var_Value^ :=
Script_Reply;
{
IF Debug_Mode THEN
Debug_Write(' --> Variable read into is #' +
ITOS( Script_Integer_1 ) + ' = ' +
Script_Variables^[Script_Integer_1].Var_Name );
}
END;
GOTO LEndCase;
END;
LInsLineSy : InsLine;
GOTO LEndCase;
LKeyDefSy : Define_Key( Script_String , Script_String_2 );
GOTO LEndCase;
LKeyFlushSy : WHILE ( KeyPressed ) DO
Read_Kbd( Ch );
GOTO LEndCase;
LKeySendSy : IF ( Key_No <> Command_Key ) THEN
Handle_Function_Key( CHR( Key_No ) )
ELSE
BEGIN
IF MyLoadOverlay( 0 , PT4SCRI, 'PT4SCRI.CHN' ) THEN
Process_Script( '' , 'K' );
END;
GOTO LEndCase;
LKeySy : IF MyLoadOverlay( 0 , PT4UTIL, 'PT4UTIL.CHN' ) THEN
Set_Input_Keys( Script_String );
GOTO LEndCase;
LLogSy : BEGIN
Toggle_Option('List session on printer', Printer_On );
Alter_Status := TRUE;
END;
GOTO LEndCase;
LMessageSy : BEGIN
Script_String := Read_Ctrls( Script_String ) +
CHR( CR ) + CHR( LF );
FOR I := 1 TO LENGTH( Script_String ) DO
IF Use_Dos_Con_Output THEN
Display_Character_Through_DOS( Script_String[I] )
ELSE
Display_Character( Script_String[I] );
END;
GOTO LEndCase;
LMenuSy : BEGIN
(* Display menu *)
Menu_Display_Choices( Script_Menu_Holder^ );
(* Get choice *)
I := Menu_Get_Choice( Script_Menu_Holder^ , Erase_Menu );
MOVE( I , Script_Variables^[Script_Integer_1].Var_Value^[1], 2 );
DISPOSE( Script_Menu_Holder );
GOTO LEndCase;
END;
LMuteSy : BEGIN
Toggle_Option('Silent Mode', Silent_Mode );
Menu_Set_Beep( NOT Silent_Mode );
GOTO LEndCase;
END;
LOpenSy : BEGIN
IF ( ( Script_Integer_1 < 1 ) OR
( Script_Integer_1 > MaxScriptOpenFiles ) ) THEN
BEGIN
Script_IO_Error := 999;
GOTO LEndCase;
END;
IF Script_File_Used[Script_Integer_1] THEN
BEGIN
(*$I-*)
CLOSE( Script_File_List[Script_Integer_1]^.F );
(*$I+*)
DISPOSE( Script_File_List[Script_Integer_1] );
END;
NEW( Script_File_List[Script_Integer_1] );
Script_File_Used[Script_Integer_1] := TRUE;
WITH Script_File_List[Script_Integer_1]^ DO
BEGIN
ReadOnly := ( Script_Integer_2 = 0 );
EOF_Seen := FALSE;
(*$I-*)
ASSIGN( F , Script_String );
CASE Script_Integer_2 OF
0: BEGIN
ASSIGN( F , Script_String );
RESET ( F );
Script_IO_Error := INT24Result;
END;
1: BEGIN
ASSIGN( F , Script_String );
REWRITE( F );
Script_IO_Error := INT24Result;
END;
2: Flag := Open_For_Append( F,
Script_String,
Script_IO_Error );
END (* CASE *);
(*$I+*)
Opened := ( Script_IO_Error = 0 );
END;
GOTO LEndCase;
END;
LGetParamSy :
LSetParamSy :
LParamSy : BEGIN
T_Type := Terminal_To_Emulate;
IF MyLoadOverlay( 0 , PT4SETP, 'PT4SETP.CHN' ) THEN
Flag := Set_Params( FALSE , Use_Script );
Done := ( Terminal_To_Emulate <> T_Type );
Alter_Status := TRUE;
GOTO LEndCase;
END;
LQuitSy : BEGIN (* Quit *)
Save_Partial_Screen( Saved_Screen, 10, 10, 55, 13 );
Draw_Menu_Frame( 10, 10, 55, 13, Menu_Frame_Color,
Menu_Title_Color, Menu_Text_Color,
'' );
IF Script_File_Mode THEN
BEGIN
IF Script_Integer_1 = 0 THEN
Script_File_Mode :=
NOT YesNo('Stop running current script (Y/N) ? ')
ELSE
BEGIN
Script_File_Mode := FALSE;
Script_File_Name[0] := #0;
Done := TRUE;
END;
IF ( NOT Script_File_Mode ) THEN
Clear_Script_Variables;
Alter_Status := TRUE;
END
ELSE IF ( When_Mode OR When_Drop_Mode ) THEN
BEGIN
When_Mode :=
NOT YesNo('Stop WHEN and WHENDROP processing (Y/N) ? ');
When_Drop_Mode := When_Mode;
IF ( NOT When_Mode ) THEN
BEGIN
Script_When_Text [0] := #0;
Script_When_Reply_Text[0] := #0;
Script_When_Drop_Text [0] := #0;
END;
END
ELSE
Done := YesNo('Are you sure you want to quit (Y/N) ? ');
Restore_Screen( Saved_Screen );
Reset_Global_Colors;
PibTerm_Done := Done;
GOTO LEndCase;
END;
LReadLnSy : IF ( Script_Integer_1 = 0 ) THEN
BEGIN
READLN( Script_Variables^[Script_Integer_2].Var_Value^ );
Script_IO_Error := INT24Result;
END
ELSE IF Script_File_Used[Script_Integer_1] THEN
WITH Script_File_List[Script_Integer_1]^ DO
BEGIN
IF ( Opened AND ReadOnly AND ( NOT EOF_Seen ) ) THEN
BEGIN
(*$I-*)
READLN( F ,
Script_Variables^[Script_Integer_2].Var_Value^ );
(*$I+*)
Script_IO_Error := INT24Result;
IF ( NOT EOF_Seen ) THEN
EOF_Seen := EOF( F );
END
ELSE
Script_IO_Error := 999;
END;
GOTO LEndCase;
LReadSy : BEGIN
{
Write_Log('U='+CHR( ORD('0') + Script_Integer_1 ), FALSE,
FALSE);
Write_Log('N='+CHR( ORD('0') + Script_Integer_3 ), FALSE,
FALSE);
}
IF Script_File_Used[Script_Integer_1] THEN
WITH Script_File_List[Script_Integer_1]^ DO
BEGIN
Flag := ( Script_Integer_1 = 0 );
IF ( Opened AND ( Flag OR ReadOnly ) ) THEN
Read_Chars( F,
Script_Variables^[Script_Integer_2].Var_Value^,
Script_Integer_3,
EOF_Seen,
Flag )
ELSE
Script_IO_Error := 999;
END;
END;
GOTO LEndCase;
LReceiveSy : BEGIN
IF LENGTH( Script_String ) > 0 THEN
FileName := Script_String;
IF ( Script_Integer_1 > 0 ) THEN
BEGIN
Trans_Type := Transfers[ Script_Integer_1 ];
Script_Transfer := TRUE;
END
ELSE
Trans_Type := None;
PibDownLoad( Trans_Type );
Script_Transfer := FALSE;
GOTO LEndCase;
END;
LResetSy : Script_Buffer_Pos := 0;
GOTO LEndCase;
LReturnSy : IF ( Script_Call_Depth > 0 ) THEN
WITH Script_Call_Stack[Script_Call_Depth] DO
BEGIN
IF ( Proc_Parameter_Count > 0 ) THEN
DISPOSE( Proc_Parameters );
Script_Buffer_Pos := Return_Addr;
Proc_Parameters := Proc_Param;
Proc_Parameter_Got := Proc_Got;
Proc_Parameter_Count := Proc_Count;
Script_Call_Depth := PRED( Script_Call_Depth );
{
IF Debug_Mode THEN
Debug_Write('---> Ret from proc to location ' +
ITOS( Script_Buffer_Pos ) );
}
END;
GOTO LEndCase;
LRInputSy : Remote_Input;
GOTO LEndCase;
LExecuteSy :
LExeNewSy :
LScriptSy : BEGIN
IF ( LENGTH( Script_String ) > 0 ) THEN
Ch := Script_String[1]
ELSE
Ch := ' ';
IF MyLoadOverlay( 0 , PT4SCRI, 'PT4SCRI.CHN' ) THEN
Process_Script( Script_String_2 , Ch );
Alter_Status := TRUE;
GOTO LEndCase;
END;
LSDumpSy : IF MyLoadOverlay( 0 , PT4UTIL, 'PT4UTIL.CHN' ) THEN
Do_Screen_Dump;
GOTO LEndCase;
LSendSy : BEGIN
IF LENGTH( Script_String ) > 0 THEN
FileName := Script_String;
IF ( Script_Integer_1 > 0 ) THEN
BEGIN
Trans_Type := Transfers[ Script_Integer_1 ];
Script_Transfer := TRUE;
END
ELSE
Trans_Type := None;
PibUpLoad( Trans_Type );
Script_Transfer := FALSE;
GOTO LEndCase;
END;
LSetSy : BEGIN
{
IF Debug_Mode THEN
Debug_Write('---> Setting variable # ' +
ITOS( Script_Integer_1 ) + ', is ' +
Script_Variables^[Script_Integer_1].Var_Name );
}
Execute_Stack( Script_Integer_1 );
GOTO LEndCase;
END;
LSetVarSy : GOTO LEndCase;
LSTextSy : BEGIN
Send_Function_Key( Read_Ctrls( Script_String ) );
Script_String[0] := #0;
GOTO LEndCase;
END;
LTextSy : BEGIN
Async_Send_String( Script_String );
Script_String[0] := #0;
GOTO LEndCase;
END;
LTimersSy : IF MyLoadOverlay( 0 , PT4UTIL, 'PT4UTIL.CHN' ) THEN
Display_Timers;
GOTO LEndCase;
LTranslateSy: IF MyLoadOverlay( 0 , PT4UTIL, 'PT4UTIL.CHN' ) THEN
Set_Translate_Table( Script_String );
GOTO LEndCase;
LViewSy : IF Review_On THEN
IF ( Review_Head > 0 ) THEN
BEGIN
IF MyLoadOverlay( 0 , PT4UTIL, 'PT4UTIL.CHN' ) THEN
Review_Captured_Text;
END
ELSE
BEGIN
Save_Partial_Screen( Saved_Screen, 10, 10, 60, 14 );
Draw_Menu_Frame( 10, 10, 60, 14, Menu_Frame_Color,
Menu_Title_Color,
Menu_Text_Color, '' );
WRITE('Review buffer empty.');
DELAY( Two_Second_Delay );
Restore_Screen( Saved_Screen );
Reset_Global_Colors;
END
ELSE
BEGIN
Save_Partial_Screen( Saved_Screen, 10, 10, 60, 14 );
Draw_Menu_Frame( 10, 10, 60, 14, Menu_Frame_Color,
Menu_Title_Color,
Menu_Text_Color, '' );
WRITE('Review buffer not active.');
DELAY( Two_Second_Delay );
Restore_Screen( Saved_Screen );
Reset_Global_Colors;
END;
GOTO LEndCase;
LWaitSy : BEGIN
TimeW := COPY( Script_String, 1, 8 );
Save_Partial_Screen( Local_Save, 10, 10, 60, 14 );
Draw_Menu_Frame( 10, 10, 60, 14, Menu_Frame_Color,
Menu_Title_Color,
Menu_Text_Color,
'Wait For Specified Time' );
WRITELN('Waiting for: ',TimeW);
WRITE ('Current time: ');
I := WhereY;
TimeN[0] := #0;
ESC_Found := FALSE;
REPEAT
TimeO := TimeN;
TimeN := TimeString( TimeOfDay , Military_Time );
IF ( TimeN <> TimeO ) THEN
BEGIN
GoToXY( 15 , I );
WRITE( TimeN );
END;
IF KeyPressed THEN
BEGIN
READ( Kbd, Ch );
IF ORD( Ch ) = ESC THEN
BEGIN
ESC_Found := TRUE;
IF KeyPressed THEN
READ( Kbd, Ch );
END;
END;
UNTIL( TimeN = TimeW ) OR ESC_Found;
Restore_Screen( Local_Save );
Reset_Global_Colors;
GOTO LEndCase;
END;
LWhereXYSy : BEGIN
I := WhereX;
J := WhereY;
MOVE( I , Script_Variables^[Script_Integer_1].Var_Value^[1], 2 );
MOVE( J , Script_Variables^[Script_Integer_2].Var_Value^[1], 2 );
END;
GOTO LEndCase;
LWriteLnSy : IF ( Script_Integer_1 = 0 ) THEN
WRITELN( Script_String )
ELSE IF Script_File_Used[Script_Integer_1] THEN
WITH Script_File_List[Script_Integer_1]^ DO
BEGIN
IF ( Opened AND ( NOT ReadOnly ) ) THEN
BEGIN
(*$I-*)
WRITELN( F , Script_String );
(*$I+*)
Script_IO_Error := INT24Result;
END
ELSE
Script_IO_Error := 999;
END;
GOTO LEndCase;
LWriteSy : IF ( Script_Integer_1 = 0 ) THEN
WRITE( Script_String )
ELSE IF Script_File_Used[Script_Integer_1] THEN
WITH Script_File_List[Script_Integer_1]^ DO
BEGIN
IF ( Opened AND ( NOT ReadOnly ) ) THEN
BEGIN
(*$I-*)
WRITE( F , Script_String );
(*$I+*)
Script_IO_Error := INT24Result;
END
ELSE
Script_IO_Error := 999;
END;
GOTO LEndCase;
LWriteLogSy : Write_Log( Script_String , FALSE , FALSE );
GOTO LEndCase;
LZapVarSy : Zap_Script_Variables( Script_Integer_1 , Script_Integer_2 );
GOTO LEndCase;
{
ELSE ;
END (* CASE *);
}
LEndCase: ;
(* Update status display if parameters *)
(* changed. *)
Do_Script_Tests := Waitstring_Mode OR When_Mode OR
WaitCount_Mode OR WaitQuiet_Mode OR
Script_Learn_Mode;
IF Reverse_Status_Colors THEN
Status_Line_Attr := ( ForeGround_Color AND 7 ) SHL 4 + BackGround_Color
ELSE
Status_Line_Attr := ( Status_BackGround_Color AND 7 ) SHL 4 + Status_ForeGround_Color;
Do_Status_Line := Show_Status_Line AND
( NOT Use_Dos_Con_Output ) AND
( NOT Graphics_Terminal_Mode );
Do_Status_Time := Do_Status_Line AND Show_Status_Time;
(* If any status stuff changed, *)
(* rewrite the status line *)
IF Do_Status_Line THEN
IF ( Alter_Status OR Reset_Comm_Port ) THEN
BEGIN
IF ( WhereY = Max_Screen_Line ) THEN
BEGIN
MoveToXY( WhereX , Max_Screen_Line - 1 );
Do_Status_Line := FALSE;
Scroll( 1, Max_Screen_Line, 1, Max_Screen_Col, 1,
ForeGround_Color, BackGround_Color );
Do_Status_Line := TRUE;
END;
Set_Status_Line_Name( Short_Terminal_Name );
Write_To_Status_Line( Status_Line_Name, 1 );
END
ELSE (* Leave status line as is *)
ELSE
IF( Save_Do_Status_Line ) THEN
BEGIN (* Remove status line that was there before *)
Status_Line_Attr := ( BackGround_Color AND 7 ) SHL 4 +
ForeGround_Color;
Do_Status_Line := TRUE;
Write_To_Status_Line( DUPL( ' ' , Max_Screen_Col ), 1 );
Do_Status_Line := FALSE;
END;
Reset_Comm_Port := FALSE;
END (* Execute_Command *);